package edu.sctu.zcy.month201505.day20150525;


import java.util.Collections;
import java.util.Hashtable;

/**
 * Created by user24 on 2015/5/25.
 */
public class HashtableDemo {

    public static void main(String[] args) {

        Hashtable hashtable = new Hashtable();
        for (int i = 0; i < 11; i++) {

            hashtable.put(new Integer(i),"值"+i);
        }
        hashtable.put(new Integer(11),"值11");
        System.out.println("总数："+hashtable.size());

        System.out.println(Collections.list(hashtable.elements()));
        System.out.println(hashtable.values());

        if(hashtable.containsKey(new Integer(8))){
            System.out.println("8的值"+hashtable.get(new Integer(8)));
        }

        if(hashtable.containsValue("值5")){
            System.out.println("值5存在");
        }
    }

}
